package tech.yangzhijie.basic.java05;

public class Java03 {
    public static void main(String[] args) {
        int a[] = new int[1000];
        for (int i = 0; i < 1000; i++) {
            a[i] = ((int)(Math.random()*100))+1;
        }

        for(int i=0;i<a.length-1;i++){
            for(int j=0;j<a.length-1-i;j++){
                if(a[j]>a[j+1]){
                    int num = a[j];
                    a[j] = a[j+1];
                    a[j+1] = num;
                }
            }
        }
        for (int i = 0; i < a.length; i++) {
            int i1 = a[i];
            if(i%25 == 0&&i!=0){
                System.out.println();
            }
            System.out.print(i1+"\t");

        }
        System.out.println();
        for(int j=1;j<101;j++){
            int num = a.length;
            int count = 0;
            for(int i=0;i<num;i++){
                if(j==a[i]){
                    count++;
                }
            }
            System.out.println(j+"出现的次数为："+count);
        }
    }
}
